package com.only4play.productcenter.api.constants;

import com.only4play.common.constants.BaseEnum;

import java.util.Optional;

/**
 * @author hinzzz www.hinzzz.cn 157957329@qq.com
 * 2024-02-27
 */
public enum SerializeType implements BaseEnum<SerializeType> {
  
  SERIALIZE(1, "可序列化"),
  UN_SERIALIZE(1, "非序列化"),

    ;

  SerializeType(Integer code, String name) {
    this.code = code;
    this.name = name;
  }

  private Integer code;
  private String name;

  @Override
  public Integer getCode() {
    return this.code;
  }

  @Override
  public String getName() {
    return this.name;
  }

  public static Optional<SerializeType> of(Integer code) {
    return Optional.ofNullable(BaseEnum.parseByCode(SerializeType.class, code));
  }

}